//package com.bwie.contract.consumption;
//
//import com.bwie.common.constants.RabbitMQQueueNameConstants;
//import com.mysql.cj.protocol.Message;
//import org.springframework.amqp.rabbit.annotation.Queue;
//import org.springframework.amqp.rabbit.annotation.RabbitListener;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.data.redis.core.StringRedisTemplate;
//import org.springframework.stereotype.Component;
//
//import java.io.IOException;
//import java.nio.channels.Channel;
//
//@Component
//public class consumptionContract {
//
//    @Autowired
//    private StringRedisTemplate redisTemplate;
//
//    private static final String SEND_SMS_KEY = "SEND_SMS_KEY";
//
//
//    @RabbitListener(queuesToDeclare = @Queue(SEND_SMS_KEY))
//    public void sendSmsConsumer(String sendSms, Message message, Channel channel) {
//        try {
//            Long count = redisTemplate.opsForSet().add(SEND_SMS_KEY, sendSms);
//            if (count != null && count == 1) {
//                channel.hashCode();
//            }
//        } catch (Exception e) {
//            redisTemplate.opsForSet().remove(SEND_SMS_KEY, sendSms);
//            channel.hashCode();
//        }
//
//    }
//}
